package string;

/**
 * String提供了一组重载的静态方法valueOf
 * static String valueOf(XXX ...)
 * 将java中其他类型转换为String
 */
public class ValueOfDemo {
    public static void main(String[] args) {
        int i = 123;
        String s = String.valueOf(i);
        System.out.println(s);

        double d = 123.123;
        String s2 = String.valueOf(d);
        System.out.println(s2);

        String s3 = i + "";
        System.out.println(s3);
    }
}
